package com.zte.moon.yutu;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 14-1-5
 * Time: 上午2:15
 * To change this template use File | Settings | File Templates.
 */
public class Area {
    private Point point1;
    private Point point2;

    public Area(Point point1, Point point2) {
        this.point1 = point1;
        this.point2 = point2;
    }

    public Point getPoint1() {
        return this.point1;
    }

    public Point getPoint2() {
        return this.point2;
    }

    public void setPoint1(Point point1) {
        this.point1 = point1;
    }

    public void setPoint2(Point point2) {
        this.point2 = point2;
    }

    public void setPoint(Point point1, Point point2) {
        this.point1 = point1;
        this.point2 = point2;
    }

    public int getMinX() {
        return point1.getX() > point2.getX() ? point2.getX() : point1.getX();
    }

    public int getMaxX() {
        return point1.getX() > point2.getX() ? point1.getX() : point2.getX();
    }

    public int getMinY() {
        return point1.getY() > point2.getY() ? point2.getY() : point1.getY();
    }

    public int getMaxY() {
        return point1.getY() > point2.getY() ? point1.getY() : point2.getY();
    }
}
